<?php

class Eleven_Resource_Catepic_Item extends CMS_Model_Resource_Db_Table_Row_Abstract
{
	
	public function getLastImage()
    {
        $select = $this->select();
        $cateId = $this->getRow()->id;
        
        $row = $this->findDependentRowset('Eleven_Resource_Picture',
            'CatePics', 
            $this->select()
                 ->where('cate = ?', $cateId)
                 ->order('id DESC')
                 ->limit(1)
        )->current();
        
        return $row;
    }
}

?>